import request from '@/config/axios'
import type { PanData } from './types'

export const getPanListApi = (params: any): Promise<IResponse> => {
    const queryParams = params.queryParams ? params.queryParams : {}
    if (params.queryParams) {
        delete params.queryParams
    }
    Object.assign(params, queryParams)
    return request.get({url: '/snapshot/page', params})
}

export const backPanApi = (row: Partial<PanData>): Promise<IResponse> => {
    const data = {company_id: row.company_id, user_id: row.user_id, id: row.id};
    return request.post({url: '/snapshot/back', data})
}
export const checkPanApi = (row: Partial<PanData>): Promise<IResponse> => {
    const data = {company_id: row.company_id, user_id: row.user_id, id: row.id};
    return request.post({url: '/snapshot/check', data})
}

export const delPanApi = (row: Partial<PanData>): Promise<IResponse> => {
    const data = {company_id: row.company_id, user_id: row.user_id, id: row.id};
    return request.post({url: '/snapshot/delete', data})
}
